<?php
include "adminfunctions.php";

// We were sent here by the form in admin/modquotes.php

$quotenum = $_POST['modbutton'];
// explode by _

$decarr = explode("_",$quotenum);
$quotestatus = $decarr[0];
$quotesqlnum = $decarr[1];
addslashes($quotestatus);
addslashes($quotesqlnum);

startsql();
if($quotestatus == "approve"){
$result = mysql_query("SELECT * FROM queue WHERE id='$quotesqlnum'") or die(mysql_error());  
 $apprquote = mysql_fetch_array( $result );
 echo $apprquote['quote']." is at ".$apprquote['id'];
} else if($quotestatus == "disapprove"){
mysql_query("DELETE FROM queue WHERE id='$quotesqlnum'") or die(mysql_error());
echo "Redirecting you to Quote Moderation";
echo '<meta http-equiv="refresh" content="0;url=./modquotes.php">';
}

endsql();



